import pandas
import numpy
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d import proj3d
from sklearn.cluster import KMeans

wine = pandas.read_csv('iris.csv')
pandas.set_option('display.width', None)
# print(wine.head())

X = wine.drop('Species', axis=1).drop('Unnamed: 0', axis=1)

estimator = KMeans(n_clusters=3)

Y = estimator.fit_predict(X)

T = numpy.array(X)
fig = plt.figure(figsize=(5, 5))
ax = fig.add_subplot(111, projection='3d')
ax.scatter(T[:, 0], T[:, 1], T[:, 2], c=Y, marker='*')
plt.show()

pandas.plotting.scatter_matrix(X, c=Y, figsize=(15, 15), marker='o', hist_kwds={'bins': 20}, s=60, alpha=.8)
plt.show()
